<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Make Controller Kit - Firmware API: Network - OSC</title>
<link href="mt_doxygen.css" rel="stylesheet" type="text/css" />
<link href="../resources/mt_doxytabs.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.header {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12pt;
	color: #222222;
}
-->
</style>
</head>

<body>
<table width="800" border="0">
    <tr>
      <td colspan="3">
        <form method="get" action="http://www.google.com/search">
          <div align="right">
            <input type="text"   name="q" size="25"
              maxlength="255" value="" />
            <input type="submit" value="Search" />
            <input type="hidden" name="sitesearch" value="makingthings.com/ref/firmware/html" />
          </div>
        </form>
       </td>
    </tr>
    <tr>
      <td><div align="center"><a href="http://www.makingthings.com">
				<img src="../resources/logo_brown_medium.png" alt="MakingThings"
									width="200" height="78" border="0" align="middle" longdesc="http://www.makingthings.com" /></a></div></td>
				<td><div align="center" class="header">
      		Make Controller Kit <br />
          Firmware API
      </div></td>
      <td><div align="center"><a href="http://www.makezine.com">
					<img src="../resources/make_logo.png" alt="MAKE Zine" 
										width="164" height="73" border="0" align="middle" longdesc="http://www.makezine.com" /></a></div></td>
    </tr>
</table>
</body>
</html>
<!-- Generated by Doxygen 1.5.4 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="classes.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>Network - OSC<br>
<small>
[<a class="el" href="group___o_s_c.html">OSC</a>]</small>
</h1>Configure the Controller Board's Network Settings via OSC.  
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
</table>
<h2><a class="anchor" name="devices">
Devices</a></h2>
There is only one Network system, so a device index is not used.<h2><a class="anchor" name="properties">
Properties</a></h2>
The Network system has seven properties<ul>
<li>address</li><li>mask</li><li>gateway</li><li>valid</li><li>mac</li><li>osc_udp_port</li><li>dhcp</li><li>webserver</li></ul>
<p>
<dl class="user" compact><dt><b>Address</b></dt><dd>The <b>address</b> property corresponds to the IP address of the Controller Board. This value can be both read and written. To set a new address, send a message like <div class="fragment"><pre class="fragment">/network/address 192.168.0.235 </pre></div> </dd></dl>
<dl class="user" compact><dt><b></b></dt><dd>To read the current IP address, omit the argument value from the end of the message: <div class="fragment"><pre class="fragment">/network/address </pre></div></dd></dl>
<dl class="user" compact><dt><b>Mask</b></dt><dd>The <b>mask</b> property corresponds to the network mask of the Controller Board. When on a subnet or local network, the network mask must be set in order for the gateway to route information to the board's IP address properly. The mask is commonly 255.255.255.0 for many home networks. </dd></dl>
<dl class="user" compact><dt><b></b></dt><dd>To set the board's network mask, send a message like <div class="fragment"><pre class="fragment">/network/mask 255.255.255.0 </pre></div> To read the current mask, omit the argument value from the end of the message: <div class="fragment"><pre class="fragment">/network/mask </pre></div></dd></dl>
<dl class="user" compact><dt><b>Gateway</b></dt><dd>The <b>gateway</b> property corresponds to the gateway address for the local network the Make Controller is on. The gateway address is the address The gateway address is commonly the address of the router on many home networks, and its value is commonly 192.168.0.1.<br>
 This value is stored in EEPROM, so it persists even after the board is powered down. </dd></dl>
<dl class="user" compact><dt><b></b></dt><dd>To set the board's gateway address, send a message like <div class="fragment"><pre class="fragment">/network/gateway 192.168.0.1 </pre></div> To read the current gateway, omit the argument value from the end of the message: <div class="fragment"><pre class="fragment">/network/gateway </pre></div></dd></dl>
<dl class="user" compact><dt><b>Valid</b></dt><dd>The <b>valid</b> property is used to make sure the board's network settings are valid. If you're manually setting the <b>address</b>, <b>gateway</b>, or <b>mask</b> settings, you'll need to send the valid message for them to take effect. </dd></dl>
<dl class="user" compact><dt><b></b></dt><dd>To set the board's current network settings as valid, send the message <div class="fragment"><pre class="fragment">/network/valid 1 </pre></div> To check if the current settings have been set as valid, send the message: <div class="fragment"><pre class="fragment">/network/valid </pre></div> with no argument value.</dd></dl>
<dl class="user" compact><dt><b>OSC UDP Port</b></dt><dd>The <b>osc_udp_port</b> property corresponds to the port that the Make Controller listens on for incoming OSC messages via UDP. This value is stored persistently, so it's available even after the board has rebooted. This is 10000 by default. </dd></dl>
<dl class="user" compact><dt><b></b></dt><dd>To tell the board to listen on port 10001, instead of the default 10000, send the message <div class="fragment"><pre class="fragment"> /network/osc_udp_port 10001 
</pre></div> To read back the port that the board is currently listening on, send the message <div class="fragment"><pre class="fragment">/network/osc_udp_port </pre></div> with no argument value.</dd></dl>
<dl class="user" compact><dt><b>DHCP</b></dt><dd>The <b>dhcp</b> property sets whether the board should try to dynamically retrieve a network address from a network router. If no DHCP server is available, the board will use the network settings stored in memory for the <b>address</b>, <b>gateway</b>, and <b>mask</b> properties. If you're connecting the board directly to your computer, DHCP will not be available, so you should turn this off. </dd></dl>
<dl class="user" compact><dt><b></b></dt><dd>To turn DHCP on, send the message <div class="fragment"><pre class="fragment"> /network/dhcp 1 
</pre></div> and the board will immediately try to get an address. To check what address the board got, send the message <div class="fragment"><pre class="fragment"> /network/address 
</pre></div> as you normally would. To turn DHCP off, send the message <div class="fragment"><pre class="fragment"> /network/dhcp 0 
</pre></div> To read whether DHCP is currently enabled on the board, send the message <div class="fragment"><pre class="fragment"> /network/dhcp 
</pre></div> with no argument value.</dd></dl>
<dl class="user" compact><dt><b>Web Server</b></dt><dd>The <b>webserver</b> property sets whether the demo web server on the Make Controller is running or not. The web server can provide current stats about the board through a web browser interface. Because the web server consumes a significant chunk of the board's resources, it's best to turn it off when you're not using it. </dd></dl>
<dl class="user" compact><dt><b></b></dt><dd>To turn the web server on, send the message <div class="fragment"><pre class="fragment"> /network/webserver 1 
</pre></div> then enter the board's IP address into the address bar of your favorite web browser. Send the message <div class="fragment"><pre class="fragment"> /network/webserver 0 
</pre></div> to turn the webserver off.</dd></dl>
<dl class="user" compact><dt><b>MAC</b></dt><dd>The <b>mac</b> property corresponds to the Ethernet MAC address of the Controller Board. This value is read-only. Each board on a network must have a unique MAC address. The MAC address is generated using the board's serial number, so ensure that your board's serial numbers are unique. </dd></dl>
<dl class="user" compact><dt><b></b></dt><dd>To read the MAC address of the Controller, send the message <div class="fragment"><pre class="fragment">/network/mac </pre></div> The board will respond by sending back an OSC message with the MAC address. </dd></dl>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Make Controller Kit</title>
<style type="text/css">
<!--
.footer {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9pt;
	color: #999999;
}
-->
</style>
</head>

<body>
<hr size="1">
<div>
  <p class="footer">The Make Controller Kit is an open source project maintained by <a href="http://www.makingthings.com">MakingThings</a>.<br />
    MakingThings code is released under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank">Apache 2.0 license</a>.<br />
    Bug tracker, development wiki and status can be found at <a href="http://dev.makingthings.com">http://dev.makingthings.com</a>.<br />
		This document was last updated on 5 Dec 2007.
</p>
</div>
<!-- Google Analytics Code -->
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-769030-1";
urchinTracker();
</script>
</body>
</html>
